package com.weipai.education.mapper;

import com.weipai.education.model.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    List<Map<String,Object>> list(@Param("start") Integer start, 
                                  @Param("end") Integer size, 
                                  @Param("userCateId") Integer userCateId, 
                                  @Param("key") String key,
                                  @Param("userId") String userId);

    List<Map<String,Object>> Mylist(@Param("start") Integer start,
                                  @Param("end") Integer size,
                                  @Param("userCateId") Integer userCateId,
                                  @Param("key") String key,
                                  @Param("userId") String userId);

    Integer listAmount(@Param("userCateId") Integer userCateId,
                       @Param("key") String key,
                       @Param("userId") String userId);

    Integer MylistAmount(@Param("userCateId") Integer userCateId,
                       @Param("key") String key,
                       @Param("userId") String userId);

    int batchDeleteById(String[] id);

    List<User> getUserByRoleId(String roleId);

    User getUserByMobile(String mobile);

    int getUserByAccountNumber(@Param("accountNumber") String accountNumber);

    List<Map<String,Object>> searchAccountNumber(@Param("accountNumber") String accountNumber);
    
    Integer allListAmount(@Param("userCateId") Integer userCateId, 
                          @Param("key") String key);

    Map<String,Object> getUserByUserId(String userId);

    User getCityCountyUser(@Param("province") String province,@Param("city") String city, @Param("county") String county, @Param("flag") int flag);

    User getUserModelByAccountNumber(String referrerAccountNumber);

    List<Map<String,Object>> userList(@Param("start") Integer start, 
                                      @Param("end") Integer size, 
                                      @Param("roleId") Integer roleId, 
                                      @Param("key") String key);

    Integer userListAmount(@Param("roleId") Integer roleId, 
                           @Param("key") String key);

    int verifyUserByAddress(@Param("flag") Integer flag,
                            @Param("province") String province, 
                            @Param("city") String city, 
                            @Param("county") String county);

    User getUserByAddress(@Param("flag") Integer flag,
                          @Param("province") String province,
                          @Param("city") String city,
                          @Param("county") String county);

    List<Map<String,Object>> getUserByAddressAndFlag(@Param("province") String province, 
                                                     @Param("city") String city, 
                                                     @Param("flag2") int flag2, 
                                                     @Param("flag1") int flag1);

    Integer getUserByAddressAndFlagAmount(@Param("province") String province, 
                                          @Param("city") String city, 
                                          @Param("userCateId") Integer userCateId, 
                                          @Param("flag2") int flag2, 
                                          @Param("flag1") int flag1,
                                          @Param("key") String key);

    List<Map<String,Object>> getUserByAddressAndFlagTwo(@Param("start") Integer start,
                                                    @Param("end") Integer end,
                                                    @Param("userCateId") Integer userCateId,
                                                    @Param("province") String province,
                                                    @Param("city") String city,
                                                    @Param("flag2") int flag2,
                                                    @Param("flag1") int flag1,
                                                        @Param("key") String key);
}